import java.util.*;

public class Text {
    //坏掉的键盘
    public static void func(String strExcep ,String strActual){
        Set<Character> setActual = new HashSet<>();
        Set<Character> setExcep = new HashSet<>();

        for(Character x : strActual.toUpperCase().toCharArray()){
            setActual.add(x);
        }

        for(Character x : strExcep.toUpperCase().toCharArray()){
            if(!setActual.contains(x) && !setExcep.contains(x)){
                System.out.print(x);
                setExcep.add(x);
            }
        }
    }
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        while(sc.hasNextLine()){
            String strEx = sc.nextLine();
            String strAc = sc.nextLine();
            func(strEx,strAc);
        }
    }

    //复制带随机指针的链表
//    public Node copyRandomList(Node head) {
//        Map<Node,Node> map = new HashMap<>();
//        Node cur = head;
//        while(cur != null){
//            Node node = new Node(cur.val);
//            map.put(cur,node);
//            cur = cur.next;
//        }
//        cur = head;
//        while(cur != null){
//            map.get(cur).next = map.get(cur.next);
//            map.get(cur).random = map.get(cur.random);
//            cur = cur.next;
//        }
//
//        return map.get(head);
//    }

    //一个数组只有一个数字出现1次，其余都出现2次，找到这个数字
    public static Set<Integer> findNum(int[] arrays){
        Set<Integer> set = new HashSet<>();
        for (int x: arrays) {
            if(!set.contains(x)){
                set.add(x);
            }else{
                set.remove(x);
            }
        }
        return set;
    }

    //10w 个 0 ~ 999 的数字，统计出现的次数
    public static Map<Integer,Integer> func1(int[] array){
        Map<Integer,Integer> map = new HashMap<>();
        for (int x: array) {
            if(map.get(x) == null){
                map.put(x,1);
            }else{
                int val = map.get(x);
                map.put(x,val + 1);
            }
        }
        return map;
    }
    //给 10 w 个数据去重
    public static Set<Integer> func2(int[] array){
        Set<Integer> set = new HashSet<>();
        for (int x: array) {
            set.add(x);
        }
        return set;
    }

    //返回 10w 个数据中第一个重复的数
    public static int func3(int[] arrays){
        Set<Integer> set = new HashSet<>();
        for (int x:arrays) {
            if(set.contains(x)){
                return x;
            }else{
                set.add(x);
            }
        }
        return -1;
    }
    public static void main1(String[] args) {

        int[] arrays = new int[10_0000];
        Random random = new Random();
        for (int i = 0; i < arrays.length; i++) {
            arrays[i] = random.nextInt(1000);
        }
        Set<Integer> set = func2(arrays);
        System.out.println(set);
       int ret =  func3(arrays);
        System.out.println(ret);
        Map<Integer,Integer> map = func1(arrays);
        System.out.println(map);
    }

    public static void main2(String[] args) {
        int[] arr = {4,1,5,8,3,2,3,8,4,1,2};
        Set<Integer> set = findNum(arr);
        System.out.println(set);
    }
}
